package site.tagtype;

import java.util.List;

import site.tagtype.base.BaseTag;

import commerce.hibernate.po.Shop;

public class ShopInfoTableTag extends BaseTag {

	private List<Shop> sList;

	public ShopInfoTableTag(List<Shop> sList) {
		this.sList = sList;
		setFlag(true);
		setTag("table");
	}

	@Override
	public String getDataDIY() {
		StringBuffer strBuf = new StringBuffer();
		strBuf.append("<tr>\n");
		strBuf.append("<td>ID</td>\n");
		strBuf.append("<td>adminName</td>\n");
		strBuf.append("<td>shopName</td>\n");
		strBuf.append("<td>principal</td>\n");
		strBuf.append("<td>address</td>\n");
		strBuf.append("<td>zipCode</td>\n");
		strBuf.append("<td>shopCompany</td>\n");
		strBuf.append("</tr>\n");
		for (Shop s : sList) {
			strBuf.append("<tr>\n");
			
			strBuf.append("<td>" + s.getId() + "</td>\n");
			strBuf.append("<td>" + s.getAdminName() + "</td>\n");
			strBuf.append("<td>" + s.getShopName() + "</td>\n");
			strBuf.append("<td>" + s.getPrincipal() + "</td>\n");
			strBuf.append("<td>" + s.getAddress() + "</td>\n");
			strBuf.append("<td>" + s.getZipcode() + "</td>\n");
			strBuf.append("<td>" + s.getShopCompany() + "</td>\n");

			strBuf.append("</tr>\n");
		}
		return strBuf.toString();
	}

}
